#!/bin/bash
retur=1
seek_power=1
change_power=1
if [ $HOME != "/root" ]
then
echo "sorry, you don't have the right to visit this scritp"
fi

while [ $retur==1 ]
do
echo "input dirtory"
read dir1
t1=$?
if [ $t1 != 0 ]
then
echo "dont input to dir1,re-input"
continue
fi

if [ -d $dir1 ]
then
break
else
echo "shurucuoru ,re-input"
retur=1
fi
done


while [ $seek_power == 1 ]
do
find $dir1 -perm -u=r >20.txt
seek_power=$?
done

if [ ! -s 20.txt ]
then 
echo "don't have this legal power "
exit
fi

echo "change legal power.........."
set `cat 20.txt`
for i in $*
do
echo -n "$i want to change enter y,or enter anything:"
read keep            
if [ "$keep" == "y" ]
then
while [ $change_power -eq 1 ]
do
chmod u-x $i
change_power=$?

done
echo "$i change success"
else
echo "not change $i"
fi
ls -d -l $i
done
echo "all change success"
